import { defineStore } from 'pinia'

import { useMemberStore } from '@/stores/member.js'
import $ajax from '../api/to8060.js'

export const useMenus = defineStore('menus', {
  state: () => ({
    sysnodes: [],
    isCollapse: false
  }),
  getters: {},
  actions: {
    async loadmenu() {
      const memberStore = useMemberStore()
      const path = '/role/q/menu/' + memberStore.member.roleid // / role / q / menu / 1
      console.log(path)
      const res = await $ajax.get(path)
      this.sysnodes = res.result
    }
  }
})
